package online.szlib.com.core.repositories;

import java.util.List;

import online.szlib.com.core.domain.User;

import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface UserRepository extends JpaSpecificationExecutor<User>, JpaRepository<User, Long> {
	
//	List<User> findByUserName(String username);
	
	List<User> findByUserName(String username, Sort sort);
	
	@Query(value="select * from users u where u.uname=?1 and u.upwd=?2",nativeQuery=true)  
	public List<User> findByUserName(String username, String password);
}
